#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include<vector>
using namespace std;

int main() {
    static int m, n;
    cin >> n >> m;
    vector<long long> arr(101010, 0);
    vector<long long> d(101010);
    int i = 0;
    for (i = 1; i <= n; i++) {
        scanf("%lld", &arr[i]);
    }
    for (i = 1; i <= n; i++) {
        d[i] = arr[i] - arr[i - 1];
    }
    int l, r, k;
    while (m--) {
        scanf("%d%d%d", &l, &r, &k);
        d[l] += k;
        if (r + 1 <= n) {
            d[r + 1] -= k;
        }
    }

    for (i = 1; i <= n; i++) {
        arr[i] = arr[i - 1] + d[i];
        cout << arr[i] << " ";
    }
    //cout << arr[n - 1] + d[n] << endl;
    return 0;

}